package com.geneticAlgorithm.wines;

public class Wine {
	private Grape grape;
	private String name;
	
	public Wine(Grape grape, String name){
		this.grape = grape;
		this.name = name;
	}
	
	public Grape getGrape() {
		return grape;
	}
	public String getName() {
		return name;
	}
	
	public int distanceTo(Wine wine){
		int distance = 0;
		if ( this.grape.getHarvest() < wine.getGrape().getHarvest() ){
			distance = this.grape.getHarvest() - wine.getGrape().getHarvest();
		}
        return distance;
    }
	
	@Override
	public String toString(){
		String str = "Nombre del vino: "+getName();
		str += "\n";
		str += "\t Uva: \n"+getGrape();
		return str;
	}
	
}
